<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of RegistrationType
 *
 * @author jozin
 */
namespace Acme\MainBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class RegistrationType extends AbstractType {
    
    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder->add('email','email', array (
                      'label'=>'Email',
                      'max_length'=>'50',
                      'error_bubbling'=>true,
                     ))
                ->add('heslo','repeated', array (
                      'type'=>'password',
                      'label'=>'Heslo',                    
                      'first_name'=> 'heslo',
                      'second_name'=>'zopakuj_heslo',
                      'invalid_message'=>'Heslá sa musia zhodovať',
                      'options'=>array(
                      'max_length'=>'50',
                      'block_name'=>'form_pass',
                      'always_empty'=>'true',
                      'error_bubbling'=>true,
                     )))
                ->add('meno','text',array(
                      'max_length'=>'30',                     
                      'error_bubbling'=>true,
                     ))
                ->add('priezvisko','text',array(
                      'max_length'=>'30',
                      'error_bubbling'=>true,
                     ))
                ->add('ulica','text',array(
                      'max_length'=>'30',
                      'error_bubbling'=>true,
                     ))
                ->add('cislo','text', array (
                      'label'=>'Číslo',
                      'max_length'=>'10',
                      'error_bubbling'=>true,
                     ))
                ->add('mesto','text',array(
                      'max_length'=>'50',
                      'error_bubbling'=>true,
                     ))
                ->add('PSC','text', array (
                      'label'=>'PSČ',
                      'max_length'=>'5',
                      'error_bubbling'=>true,
                     ))
                ->add('trieda','entity', array (
                      'class'=>'AcmeMainBundle:Trieda',
                      'property'=>'nazov',
                      'label'=>'Ročník',
                      'max_length'=>'5',
                      'error_bubbling'=>true,
                     ))
                ->add('skola','text', array (
                      'label'=>'Škola',
                      'max_length'=>'5',
                      'error_bubbling'=>true,
                     ));
                        
        parent::buildForm($builder, $options);
    }
    
    public function getName() {
        return 'acme_main_registration';
    }
}

?>
